package com.dqyt.khjc.controller;

import com.alibaba.fastjson.JSON;
import com.dqyt.khjc.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 主页信息控制器
 */
@RestController
public class HomeController {

    /**
     * 主页Service
     */
    @Autowired
    private HomeService homeService;

    /**
     * 用户主页请求
     *
     * @param request
     * @return
     */
    @RequestMapping("/api/home")
    public String home(HttpServletRequest request) {
        return JSON.toJSONString(homeService.home(request));
    }

}
